package Message.Public
{
    import Framework.MQ.*;
    import Framework.Serialize.*;

    public class SBusiness extends Object implements IMessageBase
    {
        public var operation:EBusinessOperation;
        public var fromEntity:SEntityId;
        public var businessId:String;
        public var endDt:Date;
        public var error:SErrorMsg;
        public var fromInfo:SBusinessInfo;
        public var toInfo:SBusinessInfo;
        public const _type:int = 20301;
        public static var _regist:SBusiness = new SBusiness(true);

        public function SBusiness(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            
        }

        public function getType() : int
        {
            return this._type;
        }

        public function clone() : IMessageBase
        {
            return new SBusiness();
        }

        public function __write(param1:SerializeStream) : void
        {
            this.operation.__write(param1);
            this.fromEntity.__write(param1);
            param1.writeString(this.businessId);
            param1.writeDate(this.endDt);
            this.error.__write(param1);
            this.fromInfo.__write(param1);
            this.toInfo.__write(param1);
            
        }

        public function __read(param1:SerializeStream) : void
        {
            this.operation = EBusinessOperation.__read(param1);
            this.fromEntity = new SEntityId();
            this.fromEntity.__read(param1);
            this.businessId = param1.readString();
            this.endDt = param1.readDate();
            this.error = new SErrorMsg();
            this.error.__read(param1);
            this.fromInfo = new SBusinessInfo();
            this.fromInfo.__read(param1);
            this.toInfo = new SBusinessInfo();
            this.toInfo.__read(param1);
            
        }

    }
}
